package com.guoq.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.guoq.service.IClassService;


@Controller
@RequestMapping("/class")
public class ClassController {
	@Resource
	private IClassService classService;
	
	@RequestMapping("/showClass")
	public String toIndex(HttpServletRequest request,Model model,ModelMap mdmap){
		mdmap.addAttribute("user", this.classService.getClass3(1));
		return "showUser";
	}
	
	@RequestMapping("/showClass2")
	@ResponseBody
	public String showClass2(HttpServletRequest request,Model model,ModelMap mdmap){
		return JSON.toJSONString(this.classService.getClass3(1));
	}
	
}
 